﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using Microsoft.Mtool.FSM;
using System.Xml;
using System.Xml.Serialization;

namespace MToolStudio.Render
{
    public class TourR : IRenderable
    {
        private Tour tour;
        private List<ActionR> actions = new List<ActionR>();
        private StateR entry;

        public TourR(Tour t)
        {
            tour = t;
        }

        public List<ActionR> ActionRs
        {
            get { return actions; }
            set { actions = value; }
        }

        public StateR EntryR
        {
            get { return entry; }
            set { entry = value; }
        }

        public Tour InnerTour
        {
            get { return tour; }
        }

        /// <summary>
        /// the main paint method
        /// </summary>
        /// <param name="g"></param>
        public void Paint(Graphics g)
        { }

        /// <summary>
        /// paint method to be called before any other paint being called
        /// </summary>
        /// <param name="g"></param>
        public void PrePaint(Graphics g)
        {
            if (entry != null)
                entry.PaintToured(g);
            foreach (ActionR ar in actions)
            {
                ar.PaintToured(g);
            }
        }

        /// <summary>
        /// paint method to be called after all the other main paint being called
        /// </summary>
        /// <param name="g"></param>
        public void PostPaint(Graphics g)
        { }

        /// <summary>
        /// paint method to be called if this object is focused
        /// </summary>
        /// <param name="g"></param>
        public void PaintFocus(Graphics g)
        { }

        public Point Position
        {
            get { return new Point(); }
            set { }
        }
        //double Scale { get; set; }
        //Color ForeColor { get; set; }

        /// <summary>
        /// checks whether the current renderable object is selected
        /// </summary>
        /// <param name="p"></param>
        /// <returns></returns>
        public bool IsSelected(Point p)
        {
            return false;
        }
    }
}
